<template>
	<view style="padding-bottom: 60rpx;">
		<u-navbar title=" " :autoBack="true" bgColor="transparent" leftIconColor='#fff'
			titleStyle='color:#fff;'>
		</u-navbar>
		<view class="top">
			<image class="topbg" src="./static/topbg.png" mode=""></image>
			<image class="bobg" src="./static/bobg.png" mode=""></image>
			<image class="leftbg" src="./static/leftbg.png" mode=""></image>
			<image class="rightbg" src="./static/rightbg.png" mode=""></image>
			<view class="jfnum" @click="go('/pages/integral/jflist')">
				{{userinfo.score}}
			</view>
			<view class="jfword">
				我的积分
			</view>
			<view class="topbottom">
				<view class="flex" style="font-size: 36rpx;align-items: center;padding-left: 45rpx;">
					<image style="width: 31rpx;height: 35rpx;margin-right: 11rpx;" src="./static/jf.png" mode=""></image>
					兑换商品
				</view>
				<view class="flex" @click="go('/pages/integral/list')" style="font-size: 30rpx;align-items: center;padding-right: 35rpx;">
					查看全部
					<image style="width: 14rpx;height: 25rpx;margin-left: 12rpx;" src="./static/more.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="" v-for="(item,index) in list" :key="index">
				<jfproitem :pro="item"></jfproitem>
			</view>
			
		</view>
		<view class="footer">
			<image class="footerbg" src="./static/footerbg.png" mode=""></image>
			<view class="footertitle">
				<image class="bt" style="width: 249rpx;height: 7rpx;" src="./static/bt.png" mode=""></image>
				积分规则
			</view>
			<view class="footerword">
				积分规则，介绍积分规则.积分规则，介绍积分规则.积分规则，介绍积分规则.积分规则，介绍积分规则.</br>
				积分规则，介绍积分规则.积分规则，介绍积分规则.积分规则，介绍积分规则.
			</view>
		</view>
	</view>
</template>

<script>
	import {
		userInfo
	} from '@/api/my.js'
	import {getProductByCateGory} from '@/api/product.js'
	export default {
		data() {
			return {
				userinfo:{},
				list:[]
			};
		},
		methods:{
			go(url){
				uni.navigateTo({
					url
				})
			}
		},
		onShow() {
			userInfo().then(res=>{
				uni.setStorageSync('userinfo',res.data.data)
				this.$set(this.userinfo,'score',res.data.data.score)
			})
			// uni.navigateBack()
		},
		onLoad() {
			this.userinfo=uni.getStorageSync('userinfo')
			getProductByCateGory({type:3}).then(res=>{
				this.list=res.data.data.slice(0,3)
				this.list.map(t => {
					t.img = this.$BASE_URL + t.images.split(',')[0]
				})
			})
		}
	}
</script>

<style lang="less">
	.top {
		position: relative;
		height: 1000rpx;

		.topbg {
			position: absolute;
			width: 750rpx;
			height: 750rpx;
		}

		.bobg {
			position: absolute;
			width: 750rpx;
			height: 450rpx;
			bottom: 0;
		}

		.leftbg {
			position: absolute;
			bottom: 92rpx;
			left: 0;
			width: 81rpx;
			height: 114rpx;
		}

		.rightbg {
			position: absolute;
			top: 750rpx;
			right: 0;
			width: 112rpx;
			height: 118rpx;
		}

		.jfnum {
			position: absolute;
			bottom: 176rpx;
			width: 750rpx;
			text-align: center;
			font-size: 90rpx;
			line-height: 109rpx;
			font-weight: 800;
			text-shadow: 2rpx 7rpx 18rpx rgba(255, 66, 13, 0.35);
			color: #fff;
		}
		.jfword{
			position: absolute;
			bottom: 124rpx;
			width: 750rpx;
			text-align: center;
			font-size: 30rpx;
			color: #fff;
		}
		.topbottom{
			width: 750rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #F7F7F9;
			position: absolute;
			bottom: 34rpx;
		}
	}
	page{
		background-color: #FF5F00;
	}
	.list{
		padding: 0 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;
	}
	.footer{
		width: 697rpx;
		// height: 100%;
		position: relative;
		margin: 21rpx auto;
		.footerbg{
			width: 697rpx;
			height: 100%;
			position: absolute;
		}
		.footertitle{
			width: 697rpx;
			position: absolute;
			display: flex;
			align-items: center;
			justify-content: center;
			text-align: center;
			font-size: 32rpx;
			font-weight: bold;
			color: #FF5F00;
			top: 69rpx;
			.bt{
				position: absolute;
			}
		}
		.footerword{
			position: relative;
			font-size: 25rpx;
			font-family: Adobe Heiti Std;
			font-weight: normal;
			color: #6E6E6E;
			line-height: 50rpx;
			padding: 0 40rpx;
			// top: 139rpx;
			padding-top: 139rpx;
			padding-bottom: 73rpx;
		}
	}
</style>
